#ifndef __CCUSTOM_COMBOBOX_CONTROL_H__
#define __CCUSTOM_COMBOBOX_CONTROL_H__

#include <gdiplus.h>
using namespace Gdiplus;

class CCustomComboBox : public CComboBox
{
	DECLARE_DYNAMIC(CCustomComboBox)

//*************************************************************************************************//Class Function
public:
	CCustomComboBox(void);
	~CCustomComboBox(void);

	//Common Setting
	int SetCurSel(int nSelect);
	BOOL EnableWindow(BOOL bEnable);
	void Initialize(HWND hPParentWnd, HWND hParentWnd, HDC hBgDC, HDC hDrawDC, int nParentx = 0, int nParenty = 0);

	//Image Setting
	void SetImage(UINT nDisabledID, UINT nNormalID, UINT nHoveredID, UINT nPressedID);
	void SetImage(LPCTSTR pszDisabled, LPCTSTR pszNormal, LPCTSTR pszHovered, LPCTSTR pszPressed);

	//String or Font Setting
	void SetFontSize(int nSize);
	void SetFontStyle(UINT nStyle);
	void SetFontColor(int nR, int nG, int nB);
	void SetFontFamily(CString strFontFamilyName);

	//UI Drawing
	void DrawUI();
	BOOL ShowWindow(int nCmdShow);

private:
	void SetState(int state);
	void CreateFont();

//*************************************************************************************************//Class Parameters
public:
	enum{
		CBB_DISABLED = 0,	    // Column 0 : DISABLED state
		CBB_DEFAULT = 1,		// Column 1 : DEFAULT state
		CBB_HOVERED = 2,	    // Column 2 : HOVERED state
		CBB_PRESSED = 3,        // Column 3 : PRESSED state
	};

private:
	//commom Parameter
	int m_nState;

	//String and Font Parameter
	CString m_strText;
	int m_nFontSize, m_nFontStyle;
	Gdiplus::Unit m_enFontUnit;
	Gdiplus::StringFormat* m_strTextFormat;
	Gdiplus::FontFamily* m_pFontFamily;
	Gdiplus::SolidBrush* m_pFontBrush;
	Gdiplus::Font* m_pFont;

	//UI Rect Parameter
	CRect m_rtRect, m_rtPRect, m_rtPPRect;

	//Image and Handle Parameter
	Image* m_pImg[4];
	HDC m_hBgDC, m_hDrawDC;
	HWND m_hPParentWnd, m_hParentWnd;

//*************************************************************************************************//Class Message
public:
	DECLARE_MESSAGE_MAP()
	virtual void PreSubclassWindow();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg LRESULT OnMouseLeave(WPARAM wparam, LPARAM lparam);
	afx_msg LRESULT OnMouseHover(WPARAM wparam, LPARAM lparam);
	afx_msg void OnDropdown();
	afx_msg void OnCloseUp();
	afx_msg void OnPaint();
};
#endif
